package cn.cdut.yiwenqian.entityVo;

import java.io.File;
import java.io.Serializable;

import cn.cdut.yiwenqian.entity.CdutPostNews;
import cn.cdut.yiwenqian.util.MyFileTool;

public class NewsVo implements Serializable{

	 private Integer unumber;
     private String username;
     private String name;
     private String begindate;
     private String content;
     private String image;
     private String source;
	/**
	 * @param unumber
	 * @param username
	 * @param name
	 * @param begindate
	 * @param content
	 * @param image
	 * @param source
	 */
	public NewsVo(Integer unumber, String username, String name, String begindate, String content, String image,
			String source) {
		super();
		this.unumber = unumber;
		this.username = username;
		this.name = name;
		this.begindate = begindate;
		this.content = content;
		this.image = image;
		this.source = source;
	}
	public NewsVo(CdutPostNews news) throws Exception {
		super();
		this.unumber = news.getUnumber();
		this.username = news.getCdutPostUsers().getName();
		this.name = news.getName();
		this.begindate = news.getBeginDate().toString();
		this.content = MyFileTool.readTxtFile(new File(news.getContent()));
		this.image = news.getImage();
		this.source = news.getSource();
	}
	/**
	 * @return the unumber
	 */
	public Integer getUnumber() {
		return unumber;
	}
	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @return the begindate
	 */
	public String getBegindate() {
		return begindate;
	}
	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}
	/**
	 * @return the image
	 */
	public String getImage() {
		return image;
	}
	/**
	 * @return the source
	 */
	public String getSource() {
		return source;
	}
	/**
	 * @param unumber the unumber to set
	 */
	public void setUnumber(Integer unumber) {
		this.unumber = unumber;
	}
	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @param begindate the begindate to set
	 */
	public void setBegindate(String begindate) {
		this.begindate = begindate;
	}
	/**
	 * @param content the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}
	/**
	 * @param image the image to set
	 */
	public void setImage(String image) {
		this.image = image;
	}
	/**
	 * @param source the source to set
	 */
	public void setSource(String source) {
		this.source = source;
	}
}
